package vip.xiaonuo.message.impl;

import lombok.extern.slf4j.Slf4j;
import vip.xiaonuo.facedoor.modular.message.ReliableMessageSender;
import vip.xiaonuo.facedoor.modular.message.domain.Message;
import vip.xiaonuo.message.service.ReliableMessageSendService;


@Slf4j
public class LocalTableBasedReliableMessageSender implements ReliableMessageSender {
    private final ReliableMessageSendService reliableMessageSendService;


    public LocalTableBasedReliableMessageSender(ReliableMessageSendService reliableMessageSendService) {
        this.reliableMessageSendService = reliableMessageSendService;
    }

    @Override
    public void send(Message message) {
        this.reliableMessageSendService.saveAndSend(message);
    }
}
